#define _CRT_SECURE_NO_WARNINGS 1
#include "List.h"

void ListTest1()
{
	ListNode* plist = LTInit();
	LTPushBack(plist, 1);
	LTPushBack(plist, 2);
	LTPushBack(plist, 3);
	LTPushBack(plist, 4);
	LTPrint(plist);

	LTPopBack(plist);
	LTPopBack(plist);


	LTPrint(plist);
}

void ListTest2()
{
	ListNode* plist = LTInit();
	LTPushFront(plist, 1);
	LTPushFront(plist, 2);
	LTPushFront(plist, 3);
	LTPushFront(plist, 4);

	LTPrint(plist);

	LTPopFront(plist);
	LTPopFront(plist);

	LTPrint(plist);

}

void ListTest3()
{
	ListNode* plist = LTInit();
	LTPushBack(plist, 1);
	LTPushBack(plist, 2);
	LTPushBack(plist, 3);
	LTPushBack(plist, 4);

	ListNode* pos1 = LTFindNode(plist, 3);
	LTInsert(pos1, 10);
	LTPrint(plist);

	ListNode* pos2 = LTFindNode(plist, 3);
	LTErase(pos2);
	LTPrint(plist);
	LTDestroy(&plist);

}

int main()
{
	ListTest3();
	return 0;
}